package com.supermap.business.cloud.agrinfo.user;

import com.alibaba.dubbo.config.annotation.Reference;
import com.supermap.dataservice.util.JSONUtil;

import com.supermap.dubbo.api.cloud.userloud.UserCloudService;
import com.supermap.dubbo.api.user.entity.InterNetInfo;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
import java.util.Map;

/**
 * @author aqua
 * @description
 * @date 2018年11月11 下午 6:21
 * @email 1301584033@qq.com
 */
@Controller
@RequestMapping("/cloud/user")
public class UserCloudController {

    @Reference(timeout = 1000000)
    private UserCloudService userCloudService;

    /**
     * 注册用户
     * */
    @PutMapping("/inertUser")
    @ResponseBody
        public JSONUtil inertUser(InterNetInfo interNetInfo){
        return   userCloudService.inertUser(interNetInfo);
    }

    @GetMapping("/loginNameIsUse")
    @ResponseBody
    public JSONUtil loginNameIsUse(String loginName){
        return  userCloudService.loginNameIsUse(loginName);
    }

    @GetMapping("/getUserSuply")
    @ResponseBody
    public List<Map<String, Object>> getUserSuply(String areaCode) {
        return  userCloudService.getUserSuply(areaCode);
    }
}
